package java_test;

import java.util.StringTokenizer;

public class StringSplitEmp {

    public static void main(String[] args) {
//        String str = "www-runoob-com";
//        String delimeter = "-";
//        String[] temp;
//        temp = str.split(delimeter);
//        System.out.println(temp);
//        for (int i = 0;i< temp.length;i++ ){
//            System.out.println(temp[i]);
//            System.out.println("");
//        }
//        String str1 = "www.runoob.com";
//        String[] temp1;
//        String delimeter1 = "\\.";
//        temp1 = str1.split(delimeter1);
//        for (String X : temp1){
//            System.out.println(X);
//        }
        String str = "This is String , split by StringTokenizer, created by runoob";
        StringTokenizer st = new StringTokenizer(str);
        System.out.println(str);
        while (st.hasMoreElements()) {
            System.out.println(st.nextElement());
        }
        System.out.println("-------------------------------------");
        StringTokenizer st1 = new StringTokenizer(str, ",");
        while (st1.hasMoreElements()) {
            System.out.println(st1.nextElement());
        }
    }
}
